from rich.console import Console
from rich.text import Text
from rich.panel import Panel

console = Console()

# 定义任务类
class Task:
    def __init__(self, name: str, status: str):
        self.name = name
        self.status = status

    def to_renderable(self) -> str:
        if self.status == "completed":
            return f"✅ {self.name}"
        elif self.status == "in progress":
            return f"プログレス: {self.name}"
        else:
            return f"🔥 {self.name}"

tasks = [
    Task("编写项目计划", "completed"),
    Task("设计数据库结构", "in progress"),
    Task("编写前端界面", "not started"),
    Task("开发后端接口", "not started"),
]

# 输出任务列表
task_list = [task.to_renderable() for task in tasks]
console.print(Panel("\n".join(task_list), title="Tasks"))